package com.jiang.text;

import org.springframework.scheduling.quartz.LocalTaskExecutorThreadPool;
import redis.clients.jedis.Jedis;

import java.util.concurrent.*;

public class text1 {
    public static void main(String[] args) {
        /*Jedis jedis=new Jedis("127.0.0.1",6379);
        String s=jedis.get("cc");
        jedis.set("cc","洛克汉");
        String cc1=jedis.get("cc");
        jedis.setnx("lll","牛头人");
        String boo=jedis.get("卡利姆多");
        System.out.println(s);
        System.out.println(cc1);
        System.out.println("卡利姆多="+boo);
        final Shop shop = new Shop();
        Thread thread1 = new Thread() {
            @Override
            public void run() {
                shop.buyone();
            }
        };
        Thread thread2 = new Thread() {
            @Override
            public void run() {
                shop.buyone();
            }
        };
        Thread thread3 = new Thread() {
            @Override
            public void run() {
                shop.buyone();
            }
        };
        thread1.start();
        thread2.start();
        thread3.start();*/
        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                System.out.println(Thread.currentThread().getName() + ":666");
            }
        };
        Runnable runnable2 = new Runnable() {
            @Override
            public void run() {
                System.out.println(Thread.currentThread().getName() + ":666");
            }
        };
        Thread thread = new Thread(runnable);
        Thread thread2 = new Thread(runnable2);
        /*thread.start();
        thread2.start();
*/
        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(5, 10, 100000, TimeUnit.MILLISECONDS,new LinkedBlockingDeque<Runnable>(10));
        threadPoolExecutor.execute(runnable2);
    }
}
